augroup _Template
    autocmd!
    autocmd BufNewFile *.cpp   exec ":call CppInit()"
    " autocmd BufNewFile *.html  exec ":call HtmlInit()"
    autocmd BufNewFile *.c     exec ":call CInit()"
augroup END
func CppInit() abort
    if expand("%:e") == "cpp"
        call setline(1,"#include<iostream>")
        call setline(2,"")
        call setline(3,"int main(int argc, const char *argv[]){")
        call setline(4,"\<Tab><++>")
        call setline(5,"\<Tab>return 0;")
        call setline(6,"}")
    endif
endfunc
func HtmlInit() abort
    if expand("%:e") == "html"
        call setline(1,"<!DOCTYPE html>")
        call setline(2,"<html>")
        call setline(3,"<head>")
        call setline(4,"\<Tab><meta charset=\"UTF-8\" />")
        call setline(5,"\<Tab><meta name=\"viewport\" content=\"width=device-width\" />")
        call setline(6,"\<Tab><title>Document</title>")
        call setline(7,"</head>")
        call setline(8,"<body>")
        call setline(9,"\<Tab><++>")
        call setline(10,"</body>")
        call setline(11,"</html>")
    endif
endfunc
func CInit() abort
    if expand("%:e") == "c"
        call setline(1,"#include <stdio.h>")
        call setline(2,"")
        call setline(3,"int main(int argc, char *argv[]){")
        call setline(4,"\<Tab><++>")
        call setline(5,"\<Tab>return 0;")
        call setline(6,"}")
    endif
endfunc
